home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 161 < prev    next >
Internet Message Format  |  1996-08-06  |  1KB

  1. Path: news.delcoelect.com!c2xrfs
  2. From: c2xrfs@eng.delcoelect.com (Richard F. Smiley)
  3. Newsgroups: comp.std.c
  4. Subject: Double-character operators
  5. Date: 22 Jan 1996 23:51:48 GMT
  6. Organization: Delco Electronics
  7. Distribution: world
  8. Message-ID: <4e17uk$g3@kocrsv08.delcoelect.com>
  9. NNTP-Posting-Host: koptsw53.delcoelect.com
  10. Originator: c2xrfs@koptsw53
  11.  
  12.  
  13. Is the program fragment
  14.  
  15.     if ( Boolean_A  & =  0x0020 )
  16.  
  17. legal?  Specifically, should the three-character sequence  "& ="  be
  18. treated as representing the two-character operator  "&="?  
  19.  
  20. As I understand the standard (ISO section 5.1.1.2, phase 7), the "&"
  21. is converted into one token, and the "=" is converted into another. 
  22. This then precludes treating them as one operator, and the program
  23. fragment is illegal.  
  24.  
  25. However, a compiler I respect instead treats this as a legal fragment
  26. involving the "&=" operator.  Is that allowed?  (The program fragment
  27. was caused by a bad macro definition.  If the compiler had complained,
  28. we would have found the problem earlier.)
  29. -- 
  30. Richard Smiley  (317) 451-0866  c2xrfs@eng.delcoelect.com
  31.